package com.atguigu.spring;

import com.atguigu.spring.bean.Person;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author mi
 * @time 2021/2/27 11:40
 */
public class MainTest {
	public static void main(String[] args) {
//		beansXML();
		beans2XML();
	}

	private static void beansXML() {
		ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("beans.xml");
		Person person = applicationContext.getBean(Person.class);
		person.setName("xiaohuang");
		System.out.println(person);
	}

	private static void beans2XML() {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans2.xml");
		Person bean = context.getBean(Person.class);
		System.out.println(bean);
	}
}
